<!DOCTYPE html>

<html>
  <head>
    <title>Protocol Documentation</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>
    <style>
      body {
        width: 60em;
        margin: 1em auto;
        color: #222;
        font-family: "Ubuntu", sans-serif;
        padding-bottom: 4em;
      }

      h1 {
        font-weight: normal;
        border-bottom: 1px solid #aaa;
        padding-bottom: 0.5ex;
      }

      h2 {
        border-bottom: 1px solid #aaa;
        padding-bottom: 0.5ex;
        margin: 1.5em 0;
      }

      h3 {
        font-weight: normal;
        border-bottom: 1px solid #aaa;
        padding-bottom: 0.5ex;
      }

      a {
        text-decoration: none;
        color: #567e25;
      }

      table {
        width: 100%;
        font-size: 80%;
        border-collapse: collapse;
      }

      thead {
        font-weight: 700;
        background-color: #dcdcdc;
      }

      tbody tr:nth-child(even) {
        background-color: #fbfbfb;
      }

      td {
        border: 1px solid #ccc;
        padding: 0.5ex 2ex;
      }

      td p {
        text-indent: 1em;
        margin: 0;
      }

      td p:nth-child(1) {
        text-indent: 0;  
      }

       
      .field-table td:nth-child(1) {  
        width: 10em;
      }
      .field-table td:nth-child(2) {  
        width: 10em;
      }
      .field-table td:nth-child(3) {  
        width: 6em;
      }
      .field-table td:nth-child(4) {  
        width: auto;
      }

       
      .extension-table td:nth-child(1) {  
        width: 10em;
      }
      .extension-table td:nth-child(2) {  
        width: 10em;
      }
      .extension-table td:nth-child(3) {  
        width: 10em;
      }
      .extension-table td:nth-child(4) {  
        width: 5em;
      }
      .extension-table td:nth-child(5) {  
        width: auto;
      }

       
      .enum-table td:nth-child(1) {  
        width: 10em;
      }
      .enum-table td:nth-child(2) {  
        width: 10em;
      }
      .enum-table td:nth-child(3) {  
        width: auto;
      }

       
      .scalar-value-types-table tr {
        height: 3em;
      }

       
      #toc-container ul {
        list-style-type: none;
        padding-left: 1em;
        line-height: 180%;
        margin: 0;
      }
      #toc > li > a {
        font-weight: bold;
      }

       
      .file-heading {
        width: 100%;
        display: table;
        border-bottom: 1px solid #aaa;
        margin: 4em 0 1.5em 0;
      }
      .file-heading h2 {
        border: none;
        display: table-cell;
      }
      .file-heading a {
        text-align: right;
        display: table-cell;
      }

       
      .badge {
        width: 1.6em;
        height: 1.6em;
        display: inline-block;

        line-height: 1.6em;
        text-align: center;
        font-weight: bold;
        font-size: 60%;

        color: #89ba48;
        background-color: #dff0c8;

        margin: 0.5ex 1em 0.5ex -1em;
        border: 1px solid #fbfbfb;
        border-radius: 1ex;
      }
    </style>

    
    <link rel="stylesheet" type="text/css" href="stylesheet.css"/>
  </head>

  <body>

    <h1 id="title">Protocol Documentation</h1>

    <h2>Table of Contents</h2>

    <div id="toc-container">
      <ul id="toc">
        
          
          <li>
            <a href="#user.proto">user.proto</a>
            <ul>
              
                <li>
                  <a href="#model.Test"><span class="badge">M</span>Test</a>
                </li>
              
                <li>
                  <a href="#model.User"><span class="badge">M</span>User</a>
                </li>
              
                <li>
                  <a href="#model.User.IMapEntry"><span class="badge">M</span>User.IMapEntry</a>
                </li>
              
                <li>
                  <a href="#model.User.TestMapEntry"><span class="badge">M</span>User.TestMapEntry</a>
                </li>
              
              
              
              
            </ul>
          </li>
        
        <li><a href="#scalar-value-types">Scalar Value Types</a></li>
      </ul>
    </div>

    
      
      <div class="file-heading">
        <h2 id="user.proto">user.proto</h2><a href="#title">Top</a>
      </div>
      <p></p>

      
        <h3 id="model.Test">Test</h3>
        <p>测试结构体</p><p>@map_key=int64 @slice</p>

        
          <table class="field-table">
            <thead>
              <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
            </thead>
            <tbody>
              
                <tr>
                  <td>i32</td>
                  <td><a href="#int32">int32</a></td>
                  <td></td>
                  <td><p>@msg=i @rpc=j </p></td>
                </tr>
              
                <tr>
                  <td>u32</td>
                  <td><a href="#uint32">uint32</a></td>
                  <td></td>
                  <td><p>@msg @rpc </p></td>
                </tr>
              
                <tr>
                  <td>str</td>
                  <td><a href="#string">string</a></td>
                  <td></td>
                  <td><p>@msg @rpc </p></td>
                </tr>
              
            </tbody>
          </table>

          

        
      
        <h3 id="model.User">User</h3>
        <p>用户数据</p><p>@collection</p>

        
          <table class="field-table">
            <thead>
              <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
            </thead>
            <tbody>
              
                <tr>
                  <td>ID</td>
                  <td><a href="#int64">int64</a></td>
                  <td></td>
                  <td><p>用户id
@bson=_id @msg @rpc </p></td>
                </tr>
              
                <tr>
                  <td>AccountID</td>
                  <td><a href="#int64">int64</a></td>
                  <td></td>
                  <td><p>帐号id
@bson=accountid @msg @rpc </p></td>
                </tr>
              
                <tr>
                  <td>ServerID</td>
                  <td><a href="#int32">int32</a></td>
                  <td></td>
                  <td><p>服务器ID
@msg @rpc </p></td>
                </tr>
              
                <tr>
                  <td>Name</td>
                  <td><a href="#string">string</a></td>
                  <td></td>
                  <td><p>名字
@msg @rpc </p></td>
                </tr>
              
                <tr>
                  <td>Sex</td>
                  <td><a href="#int32">int32</a></td>
                  <td></td>
                  <td><p>性别
@msg @rpc </p></td>
                </tr>
              
                <tr>
                  <td>CreateTime</td>
                  <td><a href="#int64">int64</a></td>
                  <td></td>
                  <td><p>创建时刻
@msg @rpc </p></td>
                </tr>
              
                <tr>
                  <td>Arr</td>
                  <td><a href="#int32">int32</a></td>
                  <td>repeated</td>
                  <td><p>测试数组
@msg @rpc </p></td>
                </tr>
              
                <tr>
                  <td>StrArr</td>
                  <td><a href="#string">string</a></td>
                  <td>repeated</td>
                  <td><p>测试字符串数组
@msg @rpc </p></td>
                </tr>
              
                <tr>
                  <td>Test</td>
                  <td><a href="#model.Test">Test</a></td>
                  <td></td>
                  <td><p>测试结构体
@msg @rpc </p></td>
                </tr>
              
                <tr>
                  <td>IMap</td>
                  <td><a href="#model.User.IMapEntry">User.IMapEntry</a></td>
                  <td>repeated</td>
                  <td><p>测试整型map
@msg @rpc </p></td>
                </tr>
              
                <tr>
                  <td>TestMap</td>
                  <td><a href="#model.User.TestMapEntry">User.TestMapEntry</a></td>
                  <td>repeated</td>
                  <td><p>测试结构体map
@msg @rpc </p></td>
                </tr>
              
            </tbody>
          </table>

          

        
      
        <h3 id="model.User.IMapEntry">User.IMapEntry</h3>
        <p></p>

        
          <table class="field-table">
            <thead>
              <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
            </thead>
            <tbody>
              
                <tr>
                  <td>key</td>
                  <td><a href="#int32">int32</a></td>
                  <td></td>
                  <td><p> </p></td>
                </tr>
              
                <tr>
                  <td>value</td>
                  <td><a href="#int32">int32</a></td>
                  <td></td>
                  <td><p> </p></td>
                </tr>
              
            </tbody>
          </table>

          

        
      
        <h3 id="model.User.TestMapEntry">User.TestMapEntry</h3>
        <p></p>

        
          <table class="field-table">
            <thead>
              <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
            </thead>
            <tbody>
              
                <tr>
                  <td>key</td>
                  <td><a href="#int32">int32</a></td>
                  <td></td>
                  <td><p> </p></td>
                </tr>
              
                <tr>
                  <td>value</td>
                  <td><a href="#model.Test">Test</a></td>
                  <td></td>
                  <td><p> </p></td>
                </tr>
              
            </tbody>
          </table>

          

        
      

      

      

      
    

    <h2 id="scalar-value-types">Scalar Value Types</h2>
    <table class="scalar-value-types-table">
      <thead>
        <tr><td>.proto Type</td><td>Notes</td><td>C++ Type</td><td>Java Type</td><td>Python Type</td></tr>
      </thead>
      <tbody>
        
          <tr id="double">
            <td>double</td>
            <td></td>
            <td>double</td>
            <td>double</td>
            <td>float</td>
          </tr>
        
          <tr id="float">
            <td>float</td>
            <td></td>
            <td>float</td>
            <td>float</td>
            <td>float</td>
          </tr>
        
          <tr id="int32">
            <td>int32</td>
            <td>Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.</td>
            <td>int32</td>
            <td>int</td>
            <td>int</td>
          </tr>
        
          <tr id="int64">
            <td>int64</td>
            <td>Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.</td>
            <td>int64</td>
            <td>long</td>
            <td>int/long</td>
          </tr>
        
          <tr id="uint32">
            <td>uint32</td>
            <td>Uses variable-length encoding.</td>
            <td>uint32</td>
            <td>int</td>
            <td>int/long</td>
          </tr>
        
          <tr id="uint64">
            <td>uint64</td>
            <td>Uses variable-length encoding.</td>
            <td>uint64</td>
            <td>long</td>
            <td>int/long</td>
          </tr>
        
          <tr id="sint32">
            <td>sint32</td>
            <td>Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.</td>
            <td>int32</td>
            <td>int</td>
            <td>int</td>
          </tr>
        
          <tr id="sint64">
            <td>sint64</td>
            <td>Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.</td>
            <td>int64</td>
            <td>long</td>
            <td>int/long</td>
          </tr>
        
          <tr id="fixed32">
            <td>fixed32</td>
            <td>Always four bytes. More efficient than uint32 if values are often greater than 2^28.</td>
            <td>uint32</td>
            <td>int</td>
            <td>int</td>
          </tr>
        
          <tr id="fixed64">
            <td>fixed64</td>
            <td>Always eight bytes. More efficient than uint64 if values are often greater than 2^56.</td>
            <td>uint64</td>
            <td>long</td>
            <td>int/long</td>
          </tr>
        
          <tr id="sfixed32">
            <td>sfixed32</td>
            <td>Always four bytes.</td>
            <td>int32</td>
            <td>int</td>
            <td>int</td>
          </tr>
        
          <tr id="sfixed64">
            <td>sfixed64</td>
            <td>Always eight bytes.</td>
            <td>int64</td>
            <td>long</td>
            <td>int/long</td>
          </tr>
        
          <tr id="bool">
            <td>bool</td>
            <td></td>
            <td>bool</td>
            <td>boolean</td>
            <td>boolean</td>
          </tr>
        
          <tr id="string">
            <td>string</td>
            <td>A string must always contain UTF-8 encoded or 7-bit ASCII text.</td>
            <td>string</td>
            <td>String</td>
            <td>str/unicode</td>
          </tr>
        
          <tr id="bytes">
            <td>bytes</td>
            <td>May contain any arbitrary sequence of bytes.</td>
            <td>string</td>
            <td>ByteString</td>
            <td>str</td>
          </tr>
        
      </tbody>
    </table>
  </body>
</html>

